home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / pmake / lst / RCS / lstCur.c,v < prev    next >
Encoding:
Text File  |  1992-05-19  |  1.8 KB  |  80 lines

  1. head     1.4;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.4
  10. date     88.11.17.20.52.03;  author adam;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.4
  21. log
  22. @checked in with -k by kupfer at 92.05.18.17.32.34.
  23. @
  24. text
  25. @/*-
  26.  * LstCur.c --
  27.  *    Return the current node in the list.
  28.  *    The sequential functions access the list in a slightly different way.
  29.  *    CurPtr points to their idea of the current node in the list and they
  30.  *    access the list based on it. Because the list is circular, Lst_Next
  31.  *    and Lst_Prev will go around the list forever. Lst_IsAtEnd must be
  32.  *    used to determine when to stop.
  33.  *
  34.  * Copyright (c) 1988 by University of California Regents
  35.  *
  36.  * Permission to use, copy, modify, and distribute this
  37.  * software and its documentation for any purpose and without
  38.  * fee is hereby granted, provided that the above copyright
  39.  * notice appears in all copies.  Neither the University of California nor
  40.  * Adam de Boor makes any representations about the suitability of this
  41.  * software for any purpose.  It is provided "as is" without
  42.  * express or implied warranty.
  43.  */
  44. #ifndef lint
  45. static char *rcsid =
  46. "$Id: lstCur.c,v 1.4 88/11/17 20:52:03 adam Exp $ SPRITE (Berkeley)";
  47. #endif lint
  48.  
  49. #include    "lstInt.h"
  50.  
  51. /*-
  52.  *-----------------------------------------------------------------------
  53.  * Lst_Cur --
  54.  *    Return the current node if the list is open for sequential
  55.  *    access.
  56.  *
  57.  * Results:
  58.  *    The current node or NILLNODE if the list isn't open..
  59.  *
  60.  * Side Effects:
  61.  *    None.
  62.  *
  63.  *-----------------------------------------------------------------------
  64.  */
  65. LstNode
  66. Lst_Cur (l)
  67.     Lst        l;
  68. {
  69.     register List list = (List)l;
  70.  
  71.     if ((LstValid(l) == FALSE) ||
  72.     (list->isOpen == FALSE)) {
  73.         return (NILLNODE);
  74.     } else {
  75.     return ((LstNode)list->curPtr);
  76.     }
  77. }
  78.  
  79. @
  80.